<?php

class Application_Form_Page extends Zend_Form
{
    public function init()
    {
        $this->setName('Page');
        
        $page_id = new Zend_Form_Element_Hidden('page_id');
        $page_id->addFilter('Int');

        $name = new Zend_Form_Element_Text('name');
        $name->setLabel('Tên trang:')
              ->setRequired(true)
              ->addFilter('StripTags')
              ->addFilter('StringTrim')
              ->addValidator('NotEmpty');
              
        $slug = new Zend_Form_Element_Text('slug');
        $slug->setLabel('Slug:')
       //        ->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
               
        $description = new Zend_Form_Element_Textarea('description');
        $description->setLabel('Mô tả:')
        //       ->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
               
        $content = new Zend_Form_Element_Textarea('content');
        $content->setLabel('Nội dung:')
         //      ->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');

        $parent_id = new Zend_Form_Element_Text('parent_id');
        $parent_id->setLabel('Trang cha:')
        					  ->addFilter('Int');
        					  
               
       	$language = new Zend_Form_Element_Select('language');
        $language->setLabel('Ngôn ngữ:')
        //        ->setRequired(true)
                ->addMultiOptions(array(
                 	'English' => 'English',
                	'VietNam' => 'VietNam',
                	'Cambodia' => 'Cambodia',
                	'France' => 'France'
        ));
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton');

        $this->addElements(array($page_id, $name, $slug, $description,$content, $parent_id, $language, $submit));
    }
}